package xyz.jcat.mongo;

import java.util.List;

public interface IService<D, ID> {

    D insert(D d);

    void insertBatch(List<D> documents);

    D updateById(D d);

    D getById(ID id, Class<D> clazz);

    boolean deleteById(ID id, Class<D> clazz);

    boolean inc(ID id, String field, Class<D> clazz);
    boolean inc(ID id, String field, Long count, Class<D> clazz);
    boolean inc(ID id, String field, Long count, boolean isPositiveField, Class<D> clazz);
}
